package main

import (
	"fmt"
)

type ListNote struct {
	Data int
	Next *ListNote
}

func main() {

	curNode1 := createNode(7)

	PrintNode(curNode1)
}

func createNode(n int) *ListNote {
	curNode := &ListNote{}
	cur := curNode

	for i := 1; i <= n; i++ {
		cur.Next = &ListNote{}
		cur.Next.Data = i
		cur = cur.Next
	}
	return curNode
}

func PrintNode(Node *ListNote) {
	str := "start"
	for Node != nil {
		str = str + "->" + fmt.Sprintf("%d", Node.Data)
		Node = Node.Next
	}
	fmt.Println(str)
}
